﻿CREATE FUNCTION [maint].[GetDeviceExtension]
(@DeviceName [sysname])
RETURNS NCHAR (4)
AS
BEGIN
	DECLARE @ReturnValue nchar(4)

	SET @ReturnValue = (CASE
			WHEN (@DeviceName LIKE '%_HBC_%') THEN N'.HBC'
			ELSE N'.DVC'
		END);

	RETURN(@ReturnValue)
END